<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/1/17
 * Time: 18:16
 */

namespace App\Http\Requests\Admin;


use Illuminate\Foundation\Http\FormRequest;

class NewsCategoryCreateRequest extends FormRequest
{
    public function authorize(){
        return true;
    }

    public function rules()
    {
        return [
            'name' => 'required|unique:news_category,name',
            'parent_id' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'name.required' => '名称不能为空!',
            'name.unique' => '名称不能够重复!',
            'parent_id.required' => '父分类不能为空！'
        ];
    }


}